--[[
Project			TruRP
Filename		time.lua
Description		A set of methods responsible for keeping track of time, date, day, night, light and weather.
--]]

TRU.Time = {  }
TRU.Time.Start = 1262304000 -- 1st January 2010, time to start counting (real life)
TRU.Time.Epoch = 1356998400 -- 1st January 2013, time to start counting (RP time)
TRU.Time.Speed = 6 -- Time multiplier. One real life second is equivelent to how many RP seconds?
TRU.Time.TimeFormats = {
	{
		name = "time",
		format = "%H:%M"
	}
}

function GetRPTimestamp()
	local timestamp = TRU.Time.Epoch + ( ( os.time() - TRU.Time.Start ) * TRU.Time.Speed )
	return timestamp
end

function GetRPDay()
	local timestamp = GetRPTimestamp()
	return os.date( "%A", timestamp )
end

function GetRPMonth()
	local timestamp = GetRPTimestamp()
	return os.date( "%B", timestamp )
end

function GetRPTime()
	local timestamp = GetRPTimestamp()
	return os.date( "%H:%M:%S", timestamp )
end

function GetRPDate()
	local timestamp = GetRPTimestamp()
	return os.date( "%d/%m/%Y", timestamp )
end